#include<stdio.h>
int main(){
	int T,b;
	scanf("%d",&T);
	int N;
	int a[1000],i;
	int max=0,temp,sum,j;
	float average;
	for(b=0;b<T;b++){
		scanf("%d",&N);
		for(i=0;i<N;i++){
			scanf("%d",&a[i]);	}
		
		for(j=0;j<N;j++){
		for(i=0;i<N-j-1;i++){
			if(a[i]<a[i+1]){
				temp=a[i];
				a[i]=a[i+1];
				a[i+1]=temp;
				
			}
		}
	}
		 	max=a[0];
			printf("%d ",max);
			for(j=0;j<N;j++){
				sum=sum+a[j];
			}
			average=sum*1.0/N;
			printf("%.2f",average);
			
	     	printf("\n");
		    temp=0;
		    sum=0;
		
	}
	
	
	
	
	return 0;
}
